#!/usr/bin/env python
# encoding: utf-8
'''
@author: luohui
@license: (C) Copyright 2013-2018.
@contact: 254272115@qq.com
@software: personal
@file: maketestsuite.py
@time: 2018/9/30 16:00
@desc:
'''
import unittest
from config.sysconfig import *
import time
import HTMLTestRunner

# addTest：添加具体测试用例至用例集
suite = unittest.TestSuite()
suite.addTest(你的测试用例类名('该类名下的测试用例方法名'))

# makeSuite：加载某个类下的所有测试用例至用例集
# suite = unittest.TestSuite(unittest.makeSuite(你的测试用例类名))

# discover：加载某个路径下的所有类里的所有测试用例至用例集
# suite = unittest.TestLoader().discover("你的测试用例类的路径")

if __name__=='__main__':
    # 执行测试
    filename = ReportUrl + time.strftime(ISOTIMEFORMAT, time.localtime(time.time())) + 'result.html'
    with open(filename, 'wb') as fp:
        runner = HTMLTestRunner.HTMLTestRunner(
            stream=fp,
            title='院内血糖仪测试报告',
            description='BloodGlucose3.0 App All Testcase'
            )

    runner.run(suite)

